﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HFController;

namespace HFWebApp.Control
{
    public partial class dayStar : System.Web.UI.UserControl
    {
        BagePages bp = new BagePages();
        public int lawyerid = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            hf.Model.Lawyer layer = LawyerController.getController().getDayStarLawyer();
            if (layer != null)
            {
                lawyerid = layer.ID;
                if (!Page.IsPostBack)
                {

                    if (layer == null)
                    {
                        Points.Text = "0";
                        AreaList.Text = "";
                        RealName.Text = "";
                    }
                    else
                    {
                        Points.Text = layer.Point.ToString();
                        AreaList.Text = bp.getProvinceName(layer.ProvinceID.ToString()).Replace("省", "") + bp.getCityName(layer.CityID.ToString()).Replace("市", "");
                        AreaList.NavigateUrl = bp.getDemain + "/lawyeruser/lawyerlist.aspx?cityid=" + layer.CityID.ToString();
                        RealName.Text = layer.RealName + "律师";
                        RealName.NavigateUrl = bp.getDemain + "/lawyeruser/lawyer.aspx?id=" + layer.ID.ToString();
                        faceImg.ImageUrl = bp.getDemain + bp.getUpFileFolder + layer.HeadPic;

                        answer_List.DataSource = AskController.getController().getAskList(3, AnswerController.getController().getAnswerList(3, layer.ID));
                        answer_List.DataBind();
                    }
                }
            }
        }
    }
}